// Copyright (C) 2010 Razvan Constantin <razvan.constantin@rconst.net>
//
// This file is part of FileBow.
//
// FileBow is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// FileBow is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with FileBow.  If not, see <http://www.gnu.org/licenses/>.
//
// Declaration of Navigator.

#ifndef LOGIC_NAVIGATOR_H_
#define LOGIC_NAVIGATOR_H_

#include <memory>
#include <string>
#include <vector>

#include "common/common.h"

namespace filebow {
class NavigatorImpl;

/**
 * Main class for handling the logic for file navigation.
 */
class Navigator {
  // Constructor.
  public: Navigator();
  // Destructor.
  public: ~Navigator();

  // Sets a global path to be scanned.
  public: void AddGlobalPath(const std::string& path);
  // Sets a project path to be scanned.
  public: void AddProjectPath(const std::string& path);

  // Tracks open/active/closed files.
  public: void RecordPreviouslyOpened(const std::string& file);
  public: void RecordClose(const std::string& file);
  public: void SetActiveFile(const std::string& file);

  // Builds the top of files relevant for the current state of the navigator.
  public: void BuildTop(const std::string& filter, int size, std::vector<std::string>* top) const;

  // Forces a complete rescan.
  public: void Rescan();

  // Allow waiting for scanning to complete for testing purposes.
  public: void WaitScan();

  // Implementation details.
  private: std::auto_ptr<NavigatorImpl> pimpl;

  // Prevent copy and assign.
  DISALLOW_COPY(Navigator);
};

}  // namespace filebow

#endif  // LOGIC_NAVIGATOR_H_
